package com.atung.dao;

import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;

import com.atung.model.BusCarAllocation;
import com.atung.model.CarMessageDTO;
import com.atung.provider.BusCarAllocationProvider;

@Mapper
public interface BusCarAllocationDAO {

	@InsertProvider(type=BusCarAllocationProvider.class,method="saveBusCarAllocationProvider")
	Boolean saveBusCarAllocation(BusCarAllocation busCarAllocation);
	
	@UpdateProvider(type=BusCarAllocationProvider.class,method="updateBusCarAllocationProvider")
	Boolean updateBusCarAllocation(BusCarAllocation busCarAllocation);
	
	
	/**
	 * 获取车辆信息
	 * @param id
	 * @return
	 */
	@Select("select ac.* from bus_car_allocation  bca left join adm_car ac on bca.car_id =ac.id "
			+ "where bca.id=#{id}  ")
	CarMessageDTO selectAdmCarMessage(@Param("id")Long id);
}
